<!DOCTYPE html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  
 </head>
 <body>
  <script>
var str = 'abcdeabcde';
console.log(str.lastIndexOf('a'));  	// 返回5
console.log(str.lastIndexOf('a', 3));	// 返回0，从索引3的位置往前检索

  </script>
 </body>
</html>
